/// FileName: common_text_button
/// Author: admin
/// Date: 2021-07-23 11:58
/// Description: widget为text的按钮

import 'package:flutter/material.dart';

import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:high_help_apps/common/values/colors.dart';
import 'package:high_help_apps/common/values/radii.dart';
import 'package:high_help_apps/common/values/values.dart';

import 'common_button.dart';

/// 普通按钮, 自带水波纹效果
class CommonTextButton extends StatelessWidget {
  CommonTextButton(
      {this.width,
        this.height,
        this.borderRadius,
        this.backgroundColor,
        required this.title,
        required this.onPressed,
        this.border,
        this.padding,
      this.textColor});

  final double? width;
  final double? height;

  final double? borderRadius;

  final Color? backgroundColor;
  final Border? border;
  final EdgeInsetsGeometry? padding;
  final Color? textColor;

  final String title;

  final vfunc onPressed;

  @override
  Widget build(BuildContext context) {
    return CommonButton(
      width: width,
      height: height,
      border: border,
      padding: padding,
      child: Center(
        child: Text(
          title,
          style: TextStyle(
              color: textColor ?? Colors.white,
              fontSize: 16.sp
          ),
        ),
      ),
      onPressed: onPressed,
      backgroundColor: backgroundColor ?? AppColors.primaryElement,
      borderRadius: borderRadius ?? 8.r,
    );
  }
}

